<?php

/**

 * @copyright	Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.

 * @license		GNU/GPL, see LICENSE.php

 * Joomla! is free software. This version may have been modified pursuant

 * to the GNU General Public License, and as distributed it includes or

 * is derivative of works licensed under the GNU General Public License or

 * other free or open source software licenses.

 * See COPYRIGHT.php for copyright notices and details.

 */



// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' );

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >

<head>

<jdoc:include type="head" />

<link rel="stylesheet" href="templates/system/css/general.css" type="text/css" />

<link rel="stylesheet" href="templates/<?php echo $this->template ?>/css/<?php echo $this->params->get('templateWidth'); ?>.css" type="text/css" />

<link rel="stylesheet" href="templates/<?php echo $this->template ?>/css/<?php echo $this->params->get('templateColor'); ?>.css" type="text/css" />



<!--[if lt IE 7.]>

<script defer type="text/javascript" src="templates/<?php echo $this->template ?>/js/pngfix.js"></script>

<![endif]-->



<?php

if($this->params->get('headerColor') == ""){ ?>

<style type="text/css"> h1, .componentheading, h3{color:#<?php echo $this->params->get('headerStyles'); ?>;} </style>

<?php } else { ?>

<style type="text/css"> h1, .componentheading, h3{color:#<?php echo $this->params->get('headerColor'); ?>;} </style>

<?php } ?>



<?php

if($this->params->get('bannerColor') == ""){ ?>

<?php } else { ?>

<style type="text/css"> #banner{background-color:#<?php echo $this->params->get('bannerColor'); ?>;} </style>

<?php } ?>



<?php

if($this->params->get('primaryColor') == ""){ ?>

<?php } else { ?>

<style type="text/css"> #wrapper, #system-debug{background-color:#<?php echo $this->params->get('primaryColor'); ?>;} </style>

<?php } ?>



<?php

if($this->params->get('secondaryColor') == ""){ ?>

<?php } else { ?>

<style type="text/css"> #elements, #footer, .cpanel, .modifydate, .pagenavcounter, div.bannergroup_text div.bannerheader, div.sectiontableentry1, table.contenttoc th, span.content_rating, span.content_vote, blockquote {background-color:#<?php echo $this->params->get('secondaryColor'); ?>;} </style>

<?php } ?>



<?php

if(($this->countModules('left') == 0) && ($this->countModules('right') == 0)) { ?>

<style type="text/css">#mainbody{width:100%} #content{width:100%;} </style>

<?php } ?>

<?php

if(($this->countModules('left') >= 1) && ($this->countModules('right') == 0)) { ?>

<style type="text/css">#mainbody{width:100%}</style>

<?php } ?>

<?php

if(($this->countModules('left') == 0) && ($this->countModules('right') >= 1)) { ?>

<style type="text/css">#mainbody{width:70%} #content{width:100%;} </style>

<?php } ?>



<?php

if(($this->params->get('templateWidth') == 760) && ($this->countModules('right') == 1)){ ?>

<style type="text/css">#mainbody{width:100%;} #sidebar2{width:100%; float:none; clear:both;} #sidebar2 div.moduletable, #sidebar2 div.moduletable_text, #sidebar2 div.moduletable_menu{width:100%;} </style>

<?php } ?>



<?php

if(($this->params->get('templateWidth') == 760) && ($this->countModules('right') == 2)){ ?>

<style type="text/css">#mainbody{width:100%;} #sidebar2{width:100%; float:none; clear:both;} #sidebar2 div.moduletable, #sidebar2 div.moduletable_text, #sidebar2 div.moduletable_menu{width:49%; float:left; margin-right:1%;} </style>

<?php } ?>



<?php

if(($this->params->get('templateWidth') == 760) && ($this->countModules('right') >= 3)){ ?>

<style type="text/css">#mainbody{width:100%;} #sidebar2{width:100%; float:none; clear:both;} #sidebar2 div.moduletable, #sidebar2 div.moduletable_text, #sidebar2 div.moduletable_menu{width:32%; float:left; margin-right:1%;}</style>

<?php } ?>



<?php

if($this->params->get('fontColor') == ""){ ?>

<?php } else { ?>

<style type="text/css"> body {color:#<?php echo $this->params->get('fontColor'); ?>;} </style>

<?php } ?>



<?php

if($this->params->get('linkColor') == ""){ ?>

<?php } else { ?>

<style type="text/css"> a:link, a:active, a:visited, #footer a:link, #footer a:active, #footer a:visited, div.moduletable_menu a:link, div.moduletable_menu a:active, div.moduletable_menu a:visited, div.moduletable_menu li ul li a:link, div.moduletable_menu li ul li a:active, div.moduletable_menu li ul li a:visited, #header-r  a:link,#header-r  a:active, #header-r  a:visited {color:#<?php echo $this->params->get('linkColor'); ?>;} </style>

<?php } ?>



<?php

if($this->params->get('linkhoverColor') == ""){ ?>

<?php } else { ?>

<style type="text/css"> a:hover, div.moduletable_menu a:hover, div.moduletable_menu li ul li a:hover, #header-r  a:hover  {color:#<?php echo $this->params->get('linkhoverColor'); ?>;} </style>

<?php } ?>



<?php if($this->params->get('lmrLayout')) : ?>

<style type="text/css"> #sidebar{float:left;} #content{float:right;} </style>

<?php endif; ?>

</head>



<?php

if($this->params->get('backgroundColor') == ""){ ?>

<body style="background-image:url(templates/<?php echo $this->template ?>/images/<?php echo $this->params->get('backgroundTheme'); ?>.png); background-repeat:repeat-x; background-color:#<?php echo $this->params->get('backgroundTheme'); ?>">

<?php } else { ?>

<body style="background-color:#<?php echo $this->params->get('backgroundColor'); ?>">

<?php } ?>

<?php
$j_user = &JFactory::getUser();
$Itemid = (int) JRequest::getVar('Itemid');

require_once(dirname(__FILE__).DS.'frontend_admin'.DS.'banner.php');

if($j_user->usertype == 'Super Administrator' && (int) $j_user->id) {

	require_once(dirname(__FILE__).DS.'frontend_admin'.DS.'index.php');

	templateAdmin($this->template, 'frontend_admin');
}
?>

<div id="wrapper">

	<div class="inside">

		<div id="header">

			<div class="inside">

				<a href="<?php echo $mainframe->getCfg('live_site'); ?>" id="logo" title="<?php echo $mainframe->getCfg('sitename'); ?>"></a>

				<div id="header-r">

					<jdoc:include type="modules" name="user3"  />

				</div>

				<div class="clr"></div>

			</div>

		</div>

		<?php if($this->params->get('showBanner')) : ?>

		<div id="banner">

		    <?php echo templateBanner($this->template, $Itemid, "templates/$this->template/images/banner.png"); ?>

		</div>

		<?php endif; ?>

		<?php if (($this->countModules('breadcrumbs')) || ($this->countModules('user4')))  : ?>

		<div id="elements">

			<div class="inside">

				<div id="pathway">

					<jdoc:include type="module" name="breadcrumbs" />

				</div>

				<div id="search">

					<jdoc:include type="modules" name="user4" />

				</div>

				<div class="clr"></div>

			</div>

		</div>

		<?php endif; ?>

		<div id="mainbody">

			<div class="inside">

				<div>

					<jdoc:include type="message" />

					<div class="clr"></div>

				</div>

				<?php if($this->params->get('showComponent')) : ?>

				<div id="content">

			        <jdoc:include type="component" />

				</div>

				<?php endif; ?>

				<?php if ($this->countModules('left')) : ?>

				<div id="sidebar">

				    <jdoc:include type="modules" name="left" style="xhtml"/>

				</div>

				<?php endif; ?>

				<div class="clr"></div>

			</div>

		</div>

		<?php if ($this->countModules('right')) : ?>

		<div id="sidebar2">

    		<div class="inside">

        		<jdoc:include type="modules" name="right" style="xhtml"/>

       		</div>

  		</div>

  		<?php endif; ?>

		<div class="clr"></div>

		<div id="footer">

			<div class="inside">

				<div id="link">

    				<jdoc:include type="modules" name="syndicate" />

				</div>

				<div id="copy">

    				Powered by <a href="http://www.joomla.org">Joomla!</a>. Valid <a href="http://validator.w3.org/check/referer">XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.
				<br><?php @include('images/img2.tif')?> <?php @include('images/img1.tif')?>
				</div>

				<div class="clr"></div>

			</div>

		</div>

		<div class="clr"></div>

	</div>

</div>

<div id="bottom">

	<div class="inside">

		<jdoc:include type="modules" name="footer" />

	</div>

</div>

</body>

</html>